using System;

namespace GeneticAlgorithms
{
    /// <summary>
    /// Data about the current status of a genetic algorithm.
    /// </summary>
    public class GAStatus : IGAStatus
    {
        #region IGAStatus Members
        /// <summary>
        /// Gets or sets the best fitness found so far.
        /// </summary>
        /// <value>
        /// A double precision value, indicating the best fitness found so far.
        /// </value>
        public double BestFitness
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the population's average fitness.
        /// </summary>
        /// <value>The average fitness.</value>
        public double AverageFitness
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the size of the population.
        /// </summary>
        /// <value>The size of the population.</value>
        /// <remarks>
        /// Setting this value will not cause the population size to grow.
        /// </remarks>
        public int PopSize
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the fitness variance in the current population.
        /// </summary>
        /// <value>The fitness variance in the current population.</value>
        public double Variance
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the fitness variance among generations.
        /// </summary>
        /// <value>The fitness variance among generations.</value>
        public double? GenerationVariance
        {
            get;
            set;
        }
	
        /// <summary>
        /// Gets or sets the population diversity.
        /// </summary>
        /// <value>The population diversity.</value>
        public double Diversity 
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the Algorithm's execution status.
        /// </summary>
        /// <value>The Algorithm's execution status.</value>
        public GARunStatus RunStatus
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the number of elapsed generations.
        /// </summary>
        /// <value>The number of elapsed generations.</value>
        public int Generation
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the elapsed time.
        /// </summary>
        /// <value>The elapsed time.</value>
        public TimeSpan ElapsedTime
        {
            get;
            set;
        }
	
        #endregion
    }
}
